/**
  * @file SeriesStorage.h
  * @author Przemyslaw Plutecki
**/
#pragma once
#ifndef SERIESSTORAGE_H
#define SERIESSTORAGE_H
#include <boost/noncopyable.hpp>
#include <boost/serialization/base_object.hpp>
#include <boost/ptr_container/serialize_ptr_vector.hpp>
#include "Series.h"
namespace LightChart {
/**
        @class SeriesStorage
        @author Maciej Siczek, Przemyslaw Plutecki
        @version 1.0
        @brief This class is responsible for holding Series.

        @see Storage, ChartsStorage
    */
class SeriesStorage : public boost::ptr_vector<Series>, public boost::noncopyable {
public:
    /// creates series
    /// @param const std::string name name
    /// @param DataType type type of data
    unsigned int create(const std::string name = "", DataType type = UNKNOWN);
    /// adds data to series
    /// @param const unsigned int ID ID of series
    /// @param variant_values value data value
    void add(const unsigned int ID, variant_values value);
private:
    friend class boost::serialization::access;
    template<class Archive> void serialize(Archive & ar, const unsigned int version);
};
template <class Archive> inline void SeriesStorage::serialize(Archive & ar, const unsigned int) {
    ar & boost::serialization::base_object<ptr_vector<Series>>(*this);
}
}
#endif // SERIESSTORAGE_H
